<?php 
/*
########################################################
#   RUTINAS DE ACCESO A LA BASE DE DATOS DEL		   #
#   MÓDULO DE CONCILIACIONES BANCARIAS				   #
#                                                      #
#   CREADOR         :    CMM                           #
#   FECHA CREACIÓN  :    19/04/2011                    #
#   PROYECTO        :    EROFLEX-CBK                   #
#                                                      #
#   V_0.2.0_20110419_0100                              #
#                                                      #
########################################################
*/
?>

<?php

	class classPHPLog
	{
		private $path_class_log;
		private $file_class_log;
		private $path_log;
		private $file_log;
		
		function  __construct()
		{
			date_default_timezone_set('CLT');
			
			$this -> path_class_log 	= "/u1/shares/PHPLog/cotizador/";
			$this -> file_class_log		= "PHPLog_PROD.log";
			$this -> path_log			= $this -> path_class_log;
			$this -> file_log			= $this -> file_class_log;
		}
		
		
		public function setPathLog($path)
		{
			$this -> path_log 	= $path;
		}
		
		
		public function getPathLog()
		{
			return ($this -> path_log);
		}
		
		
		public function setFileLog($file)
		{
			$this -> file_log	= $file;
		}
		
		
		public function getFileLog()
		{
			return ($this -> file_log);
		}
		
		
		
		public function debug($METHOD, $msg)
		{
			$__TYPE		= "[DEBUG]";
			$__TIME		= "[".date("D, j M Y H:i:s")."]";
			$__METHOD	= "debug";
			
			$fp = fopen($this -> path_log.$this -> file_log, "a+");
			fwrite($fp, $__TYPE.$__TIME."[".$METHOD."] ".$msg.chr(13).chr(10));
			fclose($fp);
		}
		
		
		public function info($METHOD, $msg)
		{
			$__TYPE		= "[INFO] ";
			$__TIME		= "[".date("D, j M Y H:i:s")."]";
			$__METHOD	= "info";
			
			$fp = fopen($this -> path_log.$this -> file_log, "a+");
			fwrite($fp, $__TYPE.$__TIME."[".$METHOD."] ".$msg.chr(13).chr(10));
			fclose($fp);
		}
		
		
		public function warning($METHOD, $msg)
		{
			$__TYPE		= "[WARNING] ";
			$__TIME		= "[".date("D, j M Y H:i:s")."]";
			$__METHOD	= "info";
			
			$fp = fopen($this -> path_log.$this -> file_log, "a+");
			fwrite($fp, $__TYPE.$__TIME."[".$METHOD."] ".$msg.chr(13).chr(10));
			fclose($fp);
		}
		
		
		public function error($METHOD, $msg)
		{
			$__TYPE		= "[ERROR]";
			$__TIME		= "[".date("D, j M Y H:i:s")."]";
			$__METHOD	= "info";
			
			$fp = fopen($this -> path_log.$this -> file_log, "a+");
			fwrite($fp, $__TYPE.$__TIME."[".$METHOD."] ".$msg.chr(13).chr(10));
			fclose($fp);
		}
	}
?>